// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ONImpl.java

package com.sunwayhorizo.health.hl7.datatypes.common;

import com.sunwayhorizo.health.hl7.common.VersionInfo;
import com.sunwayhorizo.health.hl7.datatypes.ANY;
import com.sunwayhorizo.health.hl7.datatypes.BL;
import com.sunwayhorizo.health.hl7.datatypes.CS;
import com.sunwayhorizo.health.hl7.datatypes.ENXP;
import com.sunwayhorizo.health.hl7.datatypes.IVL_TS;
import com.sunwayhorizo.health.hl7.datatypes.ON;
import com.sunwayhorizo.health.hl7.datatypes.SET_CS;
import com.sunwayhorizo.health.hl7.datatypes.ST;
import com.sunwayhorizo.health.hl7.datatypes.TYPE;

import java.util.Arrays;
import java.util.List;


// Referenced classes of package oracle.apps.ctb.hl7.types.common:
//            ENCommonImpl, ANYImpl, BLImpl, CSImpl, 
//            TYPEImpl

public class ONImpl extends ENCommonImpl
    implements ON
{

    public static final String RCS_ID = "$Header: ONImpl.java 115.20 2005/09/16 09:23:40 amchanda noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: ONImpl.java 115.20 2005/09/16 09:23:40 amchanda noship $", "oracle.apps.ctb.hl7.types.common");
    private static final ON nullNI = new ONImpl(CSImpl.valueOf("NI"));
    private static final ON nullOTH = new ONImpl(CSImpl.valueOf("OTH"));
    private static final ON nullNINF = new ONImpl(CSImpl.valueOf("NINF"));
    private static final ON nullPINF = new ONImpl(CSImpl.valueOf("PINF"));
    private static final ON nullUNK = new ONImpl(CSImpl.valueOf("UNK"));
    private static final ON nullASKU = new ONImpl(CSImpl.valueOf("ASKU"));
    private static final ON nullNAV = new ONImpl(CSImpl.valueOf("NAV"));
    private static final ON nullMSK = new ONImpl(CSImpl.valueOf("MSK"));
    private static final ON nullNA = new ONImpl(CSImpl.valueOf("NA"));
    private static final ON nullNASK = new ONImpl(CSImpl.valueOf("NASK"));

    public static ON valueOf(List list, SET_CS set_cs, IVL_TS ivl_ts)
    {
        return new ONImpl(list, set_cs, ivl_ts);
    }

    public static ON valueOf(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts, ST st)
    {
        return new ONImpl(aenxp, set_cs, ivl_ts, st);
    }

    public static ON valueOf(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts)
    {
        return new ONImpl(aenxp, set_cs, ivl_ts);
    }

    protected ONImpl(CS cs)
    {
        super(cs);
    }

    protected ONImpl(List list, SET_CS set_cs, IVL_TS ivl_ts)
    {
        super(list, set_cs, ivl_ts);
    }

    protected ONImpl(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts, ST st)
    {
        super(Arrays.asList(aenxp), set_cs, ivl_ts, st);
    }

    protected ONImpl(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts)
    {
        super(Arrays.asList(aenxp), set_cs, ivl_ts);
    }

    public TYPE dataType()
    {
        return com.sunwayhorizo.health.hl7.datatypes.common.TYPEImpl.ON;
    }

    public BL equal(ANY any)
    {
        if(!(any instanceof ON))
            return BLImpl.FALSE;
        if(isNull().or(any.isNull()).isTrue())
            return BLImpl.FALSE;
        else
            return super.equal(any);
    }

    public int hashCode()
    {
        return super.hashCode();
    }

    public static ON nullON(CS cs)
    {
        String s = null;
        if(cs == null || cs.literal().stringValue() == null || cs.isNull().isTrue())
            s = "NI";
        else
            s = cs.literal().stringValue();
        if(s.equals("NI"))
            return nullNI;
        if(s.equals("OTH"))
            return nullOTH;
        if(s.equals("NINF"))
            return nullNINF;
        if(s.equals("PINF"))
            return nullPINF;
        if(s.equals("UNK"))
            return nullUNK;
        if(s.equals("ASKU"))
            return nullASKU;
        if(s.equals("NAV"))
            return nullNAV;
        if(s.equals("MSK"))
            return nullMSK;
        if(s.equals("NA"))
            return nullNA;
        if(s.equals("NASK"))
            return nullNASK;
        else
            return nullNI;
    }

    @Override
    public ST formattedFlag()
    {
        // TODO Auto-generated method stub
        return null;
    }

}
